<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.autoMobile.bean.rrmSgjl" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>事故记录</title>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/styles.css">
</head>
<body>

<div class="records-container">
    <div class="records-header">

        <%
            //从作用域中获取用户列表
            List<rrmSgjl> list = (List<rrmSgjl>) request.getAttribute("list");
        %>
        <h2>事故记录</h2>
        <a href="/javaWeb24_12_war_exploded/addsgjlServlet2">增加事故记录信息</a>
        <div class="filter-bar">
            <input type="text" class="form-control" placeholder="驾驶员" style="width: 120px; margin-right: 10px;">
            <input type="text" class="form-control" placeholder="车牌号" style="width: 120px; margin-right: 10px;">
            <select class="form-control" style="width: 120px; margin-right: 10px;">
                <option>全部类型</option>
                <option>碰撞事故</option>
                <option>刮蹭事故</option>
                <option>自然灾害</option>
                <option>其他</option>
            </select>
            <select class="form-control" style="width: 120px; margin-right: 10px;">
                <option>全部状态</option>
                <option>处理中</option>
                <option>已处理</option>
            </select>
            <button class="btn">搜索</button>
        </div>
    </div>

    <div class="table-responsive">
        <table class="table">
            <thead>
            <tr>
                <th>事故时间</th>
                <th>驾驶员</th>
                <th>车牌号</th>
                <th>事故类型</th>
                <th>事故地点</th>
                <th>理赔金额</th>
                <th>详细描述</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <%
                if (list != null) {
                    // 遍历用户列表，展示每个保险的详细信息
                    for (rrmSgjl sgjl : list) {
            %>
            <tr>
                <td><%= sgjl.getSgsj()%></td>
                <td><%= sgjl.getJsy()%></td>
                <td><%= sgjl.getCph()%></td>
                <td><%= sgjl.getSglx()%></td>
                <td><%= sgjl.getSgdd()%></td>
                <td><%= sgjl.getLpje()%></td>
                <td><%= sgjl.getXxms()%></td>
                <td><%= sgjl.getZt()%></td>
                <td>
                    <a class="btn btn-small btn-secondary" href=<%= request.getContextPath() %>/admin/Updatesqlp.jsp?id=<%= sgjl.getId() %>&jsy=<%= sgjl.getJsy() %>&cph=<%= sgjl.getCph() %>&sgsj=<%= sgjl.getSgsj() %>&sgdd=<%= sgjl.getSgdd() %>&xxms=<%= sgjl.getXxms() %>&lpje=<%= sgjl.getLpje() %>">查看详情</a>
                    <button class="btn btn-small"onclick="window.location.href='<%= request.getContextPath() %>/UpdateSgjlZtServlet?id=<%= sgjl.getId() %>'">更新状态</button>
                    <button class="btn btn-small" onclick="window.location.href='<%= request.getContextPath() %>/DelSgjlServlet?id=<%= sgjl.getId() %>'">删除</button>

                </td>

            </tr>
            <%
                    }
                }
            %>
            </tbody>
        </table>
    </div>

    <div class="pagination">
        <button class="btn btn-page">&lt;</button>
        <button class="btn btn-page active">1</button>
        <button class="btn btn-page">2</button>
        <button class="btn btn-page">3</button>
        <button class="btn btn-page">&gt;</button>
    </div>
</div>
</body>
</html> 